v-model: searchInfo is not defined
一个检索输入框,输入内容,点击查询按钮,代码如下
<el-form :inline="true" class="demo-form-inline">
<el-form-item>
<el-input
v-model="searchInfo"
class="search_name"
placeholder="输入文件名称查询">
</el-input>
</el-form-item>
<el-form-item>
<el-button
link
type="primary"
icon="Search"
@click="onSearch()"
class="el-icon-search">查询
</el-button>
</el-form-item>
.....
data() {
return {
ruleForm: {
userId: '',
userName: '',
userDate: '',
userAddress: ''
},
tableData: [],
searchInfo: "",
dialogVisible: false,
}
},
。。。
onSearch() {
let postData = this.qs.stringify({
userName: this.searchInfo
});
this.axios({
。。。。
本地运行是可以的,输入关键字,点击查询,正常,但是进行打包,打包命令如下,npm run build,打包后的dist文件夹部署在服务器的nginx下,然后输入框不让输入,点击输入就报错如下:
其他文件package.json:
{
"name": "minio-upload-web",
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview --port 4173"
},
"dependencies": {
"@element-plus/icons-vue": "^2.0.10",
"axios": "^0.27.2",
"axios-extra": "^0.0.6",
"element-plus": "^2.2.14",
"promise-queue-plus": "^1.2.2",
"qs": "latest",
"spark-md5": "^3.0.2",
"vue": "^3.2.37",
"vue-element-loading": "^2.0.2",
"vue-router": "^4.1.3"
},
"devDependencies": {
"@vitejs/plugin-vue": "^3.0.1",
"@vitejs/plugin-vue-jsx": "^2.0.0",
"vite": "^3.0.4"
}
}