1
パラメータを持つVue関数が計算されています。私はクリックにバインドしようとするたびに、私が受信し、エラーError in event handler for "click": "TypeError: searchHashtag is not a function"
クリックでパラメータがある関数を呼び出すとエラーが発生する
は、ここにHTMLです:
<el-button @click="searchHashtag('#acc')">Test</el-button>
そして、ここでは、ロジックです:
data() {
messages: []
},
mounted() {
api.fetchMessages(this.projectId, (data) => {
this.messages = data.messages;
},
computed: {
searchHashtag (searchBy) {
if (_.contains(this.messages, searchBy))
this.$message('This is a message.');
}
}