A
A
Andrey Sobolev2020-06-16 14:23:10
Vue.js
Andrey Sobolev, 2020-06-16 14:23:10

How to target a simple element to a tag with a class and not a template?

Well, let's take a simple component

<template lang="jade">
div
  p {{ greeting }} World!
  OtherComponent
</template>

<script>
import OtherComponent from './OtherComponent.vue'
export default {
  components: {
    OtherComponent
  },
  data () {
    return {
      greeting: 'Hello'
    }
  }
}
</script>

<style lang="stylus" scoped>
p
  font-size 2em
  text-align center
</style>


The resulting component will only work with what lies inside the . And if I use Vue with PHP framework. And my page is rendered on the PHP side, and only after that it should be picked up by Vue. What should I do then?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question