Closed ooookai closed 6 years ago
Compile automatically Vue files in the ./private/vue/ to ./public/javascripts/vue/
./private/vue/
./public/javascripts/vue/
# run Server yarn dev # watch Vue file and use webpack to bundle it. yarn vue:dev
./webpack.vue.config.js
./private/vue/.eslintrc_vue.js
Can be use at anywhere in Vue environment
import Vue from 'vue' import Antd from 'vue-antd-ui' import axios from 'axios' import 'vue-antd-ui/dist/antd.css' Vue.prototype.$http = axios Vue.use(Antd) export default Vue
JSON.stringify()
Object.assign()
.jade file
- const server = { datafiles, id, userSignedIn, user, layerAlert: layerAlert ? true : false} script. const server = !{JSON.stringify(server)} console.log({server}) script(src="/javascripts/vue/Datasets.js")
.vue file
data() { return Object.assign(server, { maps: {}, }) },
/private/vue/ Datasets.js Datasets.vue Projects.js Projects.vue /views/ datasets.jade projects.jade
/private/vue/ Test.js Test.vue components/TestCard.vue /views/ vue.jade
looking good! I will start today.
Build VueJS dev environment
Compile
Compile automatically Vue files in the
./private/vue/
to./public/javascripts/vue/
Config Files
./webpack.vue.config.js
./private/vue/.eslintrc_vue.js
Global built-in libraries
Can be use at anywhere in Vue environment
Resources
Vue.js (reusable Vue instance)
Parsing the server side render data
Jade (Back-end) to VueJS (Front-end)
JSON.stringify()
parse the data to String.Object.assign()
to bind all server data to vue.dataExample
.jade file
.vue file
New pages
Draft datasets & projects pages
VueJS testing page