Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property or method "slotKey" is not defined on the instance at #975

Closed
1 task
47tz opened this issue Nov 2, 2018 · 4 comments
Closed
1 task

Property or method "slotKey" is not defined on the instance at #975

47tz opened this issue Nov 2, 2018 · 4 comments
Labels
has workaround Has a workaround type: bug Something isn't working type: enhancement Request to enhance an existing feature

Comments

@47tz
Copy link

47tz commented Nov 2, 2018

  • I confirm that this is a issue rather than a question.

Bug report

Version

vuepress 1.0.0-alpha.18

Steps to reproduce

I used a "ui-input" component binded v-model in ui-input.md as below:

<div class="demo-section">
<ui-input placeholder="请输入内容" v-model="formData.ipt1"></ui-input><span class="tip-error"><i class="ui-icon-warning"></i>不能为空</span>
</div>

<script type="text/javascript">
export default {
data () {
return {
formData: {
ipt1: ''
}
}
},
mounted() {
},
methods: {
postData() {
console.log(this.formData)
},
cancel() {}
},
created() {

}
}
</script>

However, it tells me "Property or method "slotKey" is not defined", until I removed all the scripts.

What is actually happening?

[Vue warn]: Property or method "slotKey" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.

Other relevant information

  • Your OS: windows 10
  • Node.js version: v11.0.0
  • Browser version: chrome 71.0.3559.6
  • Is this a global or local install? local
  • Which package manager did you use for the install? yarn
@zvinless
Copy link

zvinless commented Nov 3, 2018

You can work around this for now by adding a slot-key prop to your component (see 2a8712a)

@ulivz ulivz added the type: bug Something isn't working label Nov 3, 2018
@meteorlxy
Copy link
Member

Suggest to use ``` to wrap your code.

@ulivz ulivz added type: enhancement Request to enhance an existing feature has workaround Has a workaround labels Nov 9, 2018
@bailnl
Copy link
Contributor

bailnl commented Nov 17, 2018

I also have this problem, this may require default values.

@ulivz
Copy link
Member

ulivz commented Dec 12, 2018

Fixed at ece2e1e and out at vuepress/1.0.0-alpha.28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has workaround Has a workaround type: bug Something isn't working type: enhancement Request to enhance an existing feature
Projects
None yet
Development

No branches or pull requests

5 participants