Sha256: 8109d33e89c5e4b21a9ac88d9e09ae0834e3c24d8713ba54c12b16ca6591e4c6

Contents?: true

Size: 1.85 KB

Versions: 36

Compression:

Stored size: 1.85 KB

Contents

/* eslint no-console: 0 */
// Run this example by adding <%= javascript_pack_tag 'hello_vue' %> (and
// <%= stylesheet_pack_tag 'hello_vue' %> if you have styles in your component)
// to the head of your layout file,
// like app/views/layouts/application.html.erb.
// All it does is render <div>Hello Vue</div> at the bottom of the page.

import Vue from 'vue'
import App from '../app.vue'

document.addEventListener('DOMContentLoaded', () => {
  const app = new Vue({
    render: h => h(App)
  }).$mount()
  document.body.appendChild(app.$el)

  console.log(app)
})


// The above code uses Vue without the compiler, which means you cannot
// use Vue to target elements in your existing html templates. You would
// need to always use single file components.
// To be able to target elements in your existing html/erb templates,
// comment out the above code and uncomment the below
// Add <%= javascript_pack_tag 'hello_vue' %> to your layout
// Then add this markup to your html template:
//
// <div id='hello'>
//   {{message}}
//   <app></app>
// </div>


// import Vue from 'vue/dist/vue.esm'
// import App from '../app.vue'
//
// document.addEventListener('DOMContentLoaded', () => {
//   const app = new Vue({
//     el: '#hello',
//     data: {
//       message: "Can you say hello?"
//     },
//     components: { App }
//   })
// })
//
//
//
// If the project is using turbolinks, install 'vue-turbolinks':
//
// yarn add vue-turbolinks
//
// Then uncomment the code block below:
//
// import TurbolinksAdapter from 'vue-turbolinks'
// import Vue from 'vue/dist/vue.esm'
// import App from '../app.vue'
//
// Vue.use(TurbolinksAdapter)
//
// document.addEventListener('turbolinks:load', () => {
//   const app = new Vue({
//     el: '#hello',
//     data: () => {
//       return {
//         message: "Can you say hello?"
//       }
//     },
//     components: { App }
//   })
// })

Version data entries

36 entries across 36 versions & 4 rubygems

Version Path
jetpacker-0.4.2 lib/install/examples/vue/hello_vue.js
jetpacker-0.4.1 lib/install/examples/vue/hello_vue.js
jetpacker-0.4.0 lib/install/examples/vue/hello_vue.js
jetpacker-0.3.0 lib/install/examples/vue/hello_vue.js
jetpacker-0.2.0 lib/install/examples/vue/hello_vue.js
webpacker-4.2.2 lib/install/examples/vue/hello_vue.js
webpacker-4.2.1 lib/install/examples/vue/hello_vue.js
webpacker-4.2.0 lib/install/examples/vue/hello_vue.js
webpacker-4.1.0 lib/install/examples/vue/hello_vue.js
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/webpacker-4.0.7/lib/install/examples/vue/hello_vue.js
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/webpacker-4.0.7/lib/install/examples/vue/hello_vue.js
webpacker-4.0.7 lib/install/examples/vue/hello_vue.js
webpacker-4.0.6 lib/install/examples/vue/hello_vue.js
webpacker-4.0.5 lib/install/examples/vue/hello_vue.js
webpacker-4.0.4 lib/install/examples/vue/hello_vue.js
webpacker-4.0.3 lib/install/examples/vue/hello_vue.js