An example of a Sanity powered frontend using Vue.js
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

Sanity + Vue.js frontend example

This is an example Sanity powered frontend for the movie dataset using Vue.js.

Prerequisites

You will need Node.js version 6.0 or greater installed on your system.

Setup

Get the code by either cloning this repository using git

> git clone https://github.com/sanity-io/example-frontend-vue-js.git

... or downloading source code code as a zip archive.

Once downloaded, open the terminal in the project directory, and continue with:

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

If you're running your own Sanity project with the example movie dataset and feel like running this example with your own data, go to src/sanity.js and change the following two lines:

projectId: 'YOUR_PROJECT_ID',
dataset: 'YOUR_DATASET_NAME' <-- 'production' if you just went with the default

You can locate the ID of your project in the header of the management page for your project. You also need to enable localhost:8080 in your CORS Origins settings! Either through the management page under settings or by running this in the project folder you set up with sanity init:

sanity cors add http://localhost:8080

For a more detailed explanation on how this example works, check out the guide and docs for vue-loader.