【发布时间】:2022-02-12 15:32:36
【问题描述】:
我在我的 php 脚本中使用 vuetify 数据,它以前工作正常,现在每个页面都显示该错误为
Your search for "{{ search }}" found no results
。
似乎这个问题是因为它无法从数据库中获取数据。这是我的数据库类。
class Database
{
public $id;
public $user;
public $user_name;
public $password;
public static function db()
{
$host = 'localhost';
$dbName = 'newdata';
$userName = "root";
$password = "";
$db = "mysql:host=$host;dbname=$dbName";
try {
$pdo = new PDO($db, $userName, $password);
} catch (PDOException $e) {
throw new PDOException($e->getMessage());
}
return $pdo;
}
}
这个用户名和密码可以正常工作,我也可以使用该密码连接到远程服务器中的 sql。
这是导致上述错误的一些代码。
Balance Report
{{ props.item.col1 }}
{{ props.item.col2}}
{{ props.item.col3}}
{{ props.item.col4}}
{{ props.item.col5}}
Your search for "{{ search }}" found no results.
谁能建议它卡在哪里? 很抱歉没有在这里附上整个 php 代码,因为它工作了很多天,但它突然没有工作。
这是我的 vue 课程。
var UsageReport = new Vue({
el:'#UsageReport',
data(){
return{
Report:[],
search: '',
headers: [
{ text: 'value1', value: 'col1 ' },
{ text: 'value2', value: 'col2 ' },
{ text: 'value3', value: 'col3 ' },
{ text: 'value4', value: 'col4 ' },
{ text: 'value5', value: 'col5 ' },
],
variabl1:'',
variabl2:'',
variabl3:'',
variabl4:''
}
},