legend3---22、通过html,可以使php、vue、jquery、js达成完美的配合

legend3---22、通过html,可以使php、vue、jquery、js达成完美的配合

一、总结

一句话总结:

可以将html作为数据的中转站,无论是在html文档里面,还是html标签上。这样就可以实现各种语言或者工具之间的通信
 1 <ul class="question_circle_nav_list">
 2     <li><a onclick="a_do_question(this)" data-e_url="{{url('/do_question')}}" style="cursor: pointer;" class="question_nav_smart "><i class="fa fa-superpowers fa-fw" aria-hidden="true"></i></a><span>智能刷题</span></li>
 3     <li><a onclick="a_do_question(this)" data-e_url="{{url('/review_exam')}}" style="cursor: pointer;" class="question_nav_latest "><i class="fa fa-book fa-fw" aria-hidden="true"></i></a><span>复习测试</span></li>
 4     <li><a onclick="a_do_question(this)" data-e_url="{{url('/recent_exam')}}" style="cursor: pointer;" class="question_nav_review"><i class="fa fa-calendar-minus-o fa-fw" aria-hidden="true"></i></a><span>近期测试</span></li>
 5     <li><a onclick="a_do_question(this)" data-e_url="{{url('/lesson_exam')}}" style="cursor: pointer;" class="question_nav_lesson "><i class="fa fa-list-alt fa-fw" aria-hidden="true"></i></a><span>课程测试</span></li>
 6 </ul>
 7 <script>
 8     function a_do_question(_this) {
 9         if(parseInt(window.question_total_num)<=0){
10             layer_alert_fail('请先完成课程视频以便使题库中有题');
11         }else{
12             let url=$(_this).data('e_url');
13             window.location.href=url;
14         }
15     }
16 </script>

1、laravel中的图片可以用绝对路径?

用相对路径可能会出问题:asset('attachment/lesson/'.$path)
return ['valid' => 1, 'message' => asset('attachment/lesson/'.$path)];
//return ['valid' => 1, 'message' => 'attachment/lesson/'.$path];

2、webstorm怎么改变文件的编码方式?

设置项目文件的默认编码可以在 File----Settings-----editor---file encoding中设置 ( 快捷键:ctrl+alt+s )

3、html设置下划线两种方式?

u标签和text-decoration:underline

4、html设置删除线的两种方式?

del标签和text-decoration: line-through;

5、html斜体的实现方式?

em标签,i标签,font-style: italic;

6、laravel资源路由如何使用?

再重新写个方法,不必用资源路由里面的方法
public function index()
{
    
}

//带参数的index方法
public function index_param($lesson_id=0){
    session(['nowControllerAction'=>AppModelControllerAndFunction::jointControllerAndFunction()]);
    //1、找到所有课程
    $lessons=Lesson::orderBy('l_id','desc')->get();
    $lessons=$lessons->toArray();

    //1、找到第一门课程
    if($lesson_id){
        $first_lesson_id=$lesson_id;
    }else{
        $first_lesson_id=0;
        if(isset($lessons[0]['l_id'])) $first_lesson_id=$lessons[0]['l_id'];
    }

    //dd($first_lesson_id);
    //2、找到第一门课程的所有章节
    $chapters=Chapter::where('c_l_id',$first_lesson_id)->orderBy('c_id','desc')->get();

    //$lessons=json_encode($lessons);
    //dd($lessons);
    return view('admin.chapter.index',compact(['chapters','first_lesson_id','lessons']));
}

7、vue的select的默认中?

通过v-model来:select上v-model的值为option默认选中的那项的值(value)
<select v-model="chapter_select" name="v_c_id" id="v_c_id" class="form-control" required>
    <option v-for="chapter in chapters" :value="chapter.c_id">@{{chapter.c_name}}</option>
</select>
new Vue({
    el:"#edit_video",
    data:{
        lessons:window.lessons,
        chapters:window.chapters,
        lesson_id:window.lesson_id,
        chapter_select:window.video_chapter_select,
    }
});

8、failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found 原因?

博客未发布或者已删除:导致无法访问,就会出这个错误

9、layer和layer_mobile如何实现和谐统一?

用一个window的变量,默认表示为layer,在layer_mobile的时候将这个值切换为layer_mobile,在全局导航中根据值判断即可

10、vue中Property or method "xxxx" is not defined on the instance but referenced during render.?

应该是methods中没有找到这个方法,在vue的模板操作里面直接找js中的方法可能找不到,vue的代码块中找js中的方法可以找到

二、内容在总结中

 
原文地址:https://www.cnblogs.com/Renyi-Fan/p/12084715.html