0👍
Your new component should look something like this:
<template>
<label class="title">{{ caption }}</label>
<span class="score float-right">Score: {{ onTime }}</span>
</template>
<script>
export default
{
name: 'MyNewComponent',
props:
{
caption:
{
type: String,
default: ''
},
onTime:
{
type: [String, Number],
default: 0
}
}
}
</script>
Then you can call your component in this way:
<my-new-component :caption="Big title" :on-time="score.ap_ontime" />
- [Vuejs]-Getting Vuex error in watcher but I'm not using Vuex [Nuxt]
- [Vuejs]-How to create an input box in vue js, that user can manually adjust the href of a button to what writen in the box after submit it
Source:stackexchange.com