[Vuejs]-Vue multi modal and component

0πŸ‘

{{item.modalTemplate}} won’t compile a string into a vue component.

Place the <div slot="title"@click="$emit('close')>add new 1</div> in the <template> inside the <modal> and use v-if to change what to show, for example:

in <template>:

<div v-if="item.title" slot="title" @click="$emit('close')>{{item.title}}</div>

in <script>:

data: () => ({
  actions: [{
    name: 'add-new-1',
    show: false,
    title: "add new 1"
  },
  ...

Leave a comment