-
Notifications
You must be signed in to change notification settings - Fork 433
Closed
Description
Here is my current code that works, because I explicitly register the component
(this is the <script> part of a Single File component)
import Todo from '@/models/todo'
import {Vue, Prop, Component} from 'vue-property-decorator'
@Component({
name: 'todo-list-item' // <---didn't work
})
class TodoListItem extends Vue {
@Prop({default: false})
todo: Todo
}
Vue.component('todo-list-item', TodoListItem) // <---so have to do this
export default TodoListItem
I believe, this should have worked,
import Todo from '@/models/todo'
import {Vue, Prop, Component} from 'vue-property-decorator'
@Component({
name: 'todo-list-item' //<--- should work
})
export default class TodoListItem extends Vue {
@Prop({default: false})
todo: Todo
}
The error I get (with code sample 2) is
[Vue warn]: Unknown custom element: <todo-list-item> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
When I include this component from any other place
Saka7, ZaidRehman, pumano, YingXiaoMing, casey-prominenttechnology and 2 more
Metadata
Metadata
Assignees
Labels
No labels