This is an example Sanity powered frontend for the movie dataset using Vue.js.
You will need Node.js version 6.0 or greater installed on your system.
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:
npm install
npm run serve
npm run build
npm run lint
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.