A
A
anriko2021-02-03 10:02:35
Vue.js
anriko, 2021-02-03 10:02:35

Is it possible to use component import if Vue.js is connected to the landing page through a script?

and tell me where you can find made-up landing pages on Vue.js, for example
601a4f282688c676898178.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Vasilev, 2021-02-03
@Nolis

just like this:

Vue.component('button-counter', {
  data: function () {
    return {
      count: 0
    }
  },
  template: '<button v-on:click="count++">Счётчик кликов — {{ count }}</button>'
})

In theory it is possible, but does it make sense? will not be the same as in

K
Konstantin B., 2021-02-03
@Kostik_1993

Oh gods. Why use Vue on a landing page if you don't know how to use it?
Well, let's say I answer you how, then it will become easier or we will see the next question, but how in Vue?

import Vue from 'vue'
import Calc from './Calc.vue'

new Vue({
  render: h => h(Calc)
}).$mount('#calc')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question