报了以下错误:Module build failed (from ./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js)
Module build failed (from ./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js):
改正前:
import {Component, Vue} from 'vue-property-decorator'
import Search from '@/component/search/search.vue'
import Filter from '@/component/filter/filter.vue'
@Component({
components:{
Search, Filter
}
})
interface PageOptions {
search: string //搜索内容
}
export default class SearchResult extends Vue{
private inputValue: string
onLoad(options:PageOptions){
this.inputValue = options.search
}
}
改正后:
import {Component, Vue} from 'vue-property-decorator'
import Search from '@/component/search/search.vue'
import Filter from '@/component/filter/filter.vue'
interface PageOptions {
search: string //搜索内容
}
@Component({
components:{
Search, Filter
}
})
export default class SearchResult extends Vue{
private inputValue: string
onLoad(options:PageOptions){
this.inputValue = options.search
}
}
其实就是接口PageOptions的位置换一换就好了,那句话说修饰器要放在类前面,估计我一开始写在中间,影响他们的感情了吧。不知道我这样理解对不对,哈哈哈哈