使用以下代码时:https: //github.com/iamshaunjp/vuejs-playlist/blob/lesson-18/src/App.vue
我的浏览器显示function () { [native code] }它应显示"heeey cowboy"的位置.
知道发生了什么事吗?我在这里使用CLI 进行教程,所有内容都与提供的文件完全相同.
我一直在尝试查询moodle数据库,需要使用DB :: raw().但它一直在尝试使用默认的mysql连接.这是我想要运行的查询.
SELECT mdl_course.id, mdl_course.category, mdl_course.fullname, mdl_course_categories.name, mdl_enrol.cost, FROM_UNIXTIME(mdl_course.startdate, '%m/%d/%y') AS startdate
FROM mdl_course
LEFT JOIN mdl_course_categories ON mdl_course_categories.id = mdl_course.category
LEFT JOIN mdl_enrol ON mdl_enrol.courseid = mdl_course.id AND mdl_enrol.enrol = 'paypal';
Run Code Online (Sandbox Code Playgroud)
这是我在我的模型中尝试过的
$result = DB::connection('mysql2')->table('mdl_course')
->select(['mdl_course.id', 'mdl_course.category', 'mdl_course.fullname', 'mdl_course_categories.name', 'mdl_enrol.cost', DB::raw("FROM_UNIXTIME(mdl_course.startdate, '%m/%d/%y') AS startdate"])
->join('mdl_course_categories', 'mdl_course_categories.id', '=', 'mdl_course.category', 'left')
->join(DB::raw("LEFT JOIN mdl_enrol ON mdl_enrol.courseid = mdl_course.id AND mdl_enrol.enrol = 'paypal'"))
->where(function($query) use ($id) {
if ($id)
{
$query->where('mdl_course.id', '=', $id);
}
})
->orderBy('mdl_course.fullname', 'ASC')
->get();
Run Code Online (Sandbox Code Playgroud)
它一直在尝试使用默认的mysql连接,这是空的.从我到目前为止所读到的,db :: raw()将使用默认连接.这是真的?我该如何运行此查询?
我看到了另一个这样的问题,但答案对我不起作用,我不知道为什么.当超过50px时,为什么我的popover内容不滚动?还有一个侧面问题:在我的变量'a'中,我的换行符不在popover中.谁知道为什么?
var a = "hello \n hello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \n hello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \nhello \n";
$(function() {
$('[data-toggle="popover"]').popover()
});
$("#button1").attr('data-content', a);Run Code Online (Sandbox Code Playgroud)
.popover-content {
height: 10px;
overflow-y: auto;
} …Run Code Online (Sandbox Code Playgroud)