Sanity + Vue.js frontend example
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:
# 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 cors add http://localhost:8080