cesandoval / PaintingWData

Painting with Data
http://paintingwithdata.com
MIT License
2 stars 0 forks source link

Vueify #217

Closed ooookai closed 6 years ago

ooookai commented 6 years ago

Build VueJS dev environment

Compile

Compile automatically Vue files in the ./private/vue/ to ./public/javascripts/vue/

# run Server
yarn dev
# watch Vue file and use webpack to bundle it.
yarn vue:dev

Config Files

Global built-in libraries

Can be use at anywhere in Vue environment

Resources

Vue.js (reusable Vue instance)

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

Parsing the server side render data

Jade (Back-end) to VueJS (Front-end)

Example

.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: {},
    })
  },

New pages

Draft datasets & projects pages

/private/vue/
  Datasets.js
  Datasets.vue
  Projects.js
  Projects.vue
/views/
  datasets.jade
  projects.jade

VueJS testing page

/private/vue/
  Test.js
  Test.vue
  components/TestCard.vue
/views/
  vue.jade
panthersuper commented 6 years ago

looking good! I will start today.