不了了了了了之

687 经验值

我用jquery写了一个timepicker

        $(function () {
            $('#datetimepicker1').datetimepicker({
                format: 'YYYY-MM-DD'
            });
            $("#datetimepicker1").on("dp.change", function (e) {
                currDate = e.date;
             });
        });


        var vm = new Vue({

            el: "#app",

            components: {axios, moment},

            data() {
                return {
                    selectedDay: currDate,
                    validated: false
                }
            },

每当currDate发生变化(用户选择了新日期),我怎么让vue里对应的一个data(也就是selectedDay)也改变?我目前的知识就是只知道vue如何监听vue里的数据,不是很懂怎么也监听jquery里的。

求助!

@JellyBool

搞懂了,因为没有handle删除文章的情况,就造成空了

这个

{ $activity->subject }

还可以显示:

{"id":68,"user_id":51,"channel_id":2,"title":"sdcsd","body":"<p>ecsadawawdawdawdawd<\/p>","created_at":"2017-08-22 05:33:38","updated_at":"2017-08-22 05:33:38","replies_count":0,"creator":{"id":51,"name":"TG","email":"[email protected]","created_at":"2017-08-04 06:57:37","updated_at":"2017-08-04 06:57:37"},"channel":{"id":2,"name":"Python","slug":"python","created_at":"2017-08-04 05:39:37","updated_at":"2017-08-04 05:39:37"}

里面是有body这个属性的,但是我再进一步

    { $activity->subject->body }

就开始报错了:

(3/3) ErrorException
Trying to get property of non-object

我有一个bug
如果我在blade.php文件里的<a href=" ....... ">里写

          $activity->subject->path()  

就会得到下图这个报错

Call to a member function path() on null (View: /Users/tg/Desktop/MyWork/forum/resources/views/profiles/activities/created_thread.blade.php) (View: /Users/tg/Desktop/MyWork/forum/resources/views/profiles/activities/created_thread.blade.php)

但是同样的,如果我用dd检测:

          dd($activity->subject->path())  

就会得到我应该有的路径

"/threads/python/68"

求问这是怎么回事?

后来我把app.js和css换成了bootstrap就好了,不知道是为什么会这样

我引用了一个文本编辑器的js,然后和原本laravel 的app.js冲突了。如果两个都有,前者就没有办法正常显示。

请问这种情况要如何化解?如何使两个都存在且不冲突?or在textarea特定的标签里使用指定的js?

求助啊!!!

    <!-- Include external JS libs. -->
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.25.0/codemirror.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.25.0/mode/xml/xml.min.js"></script>
    <!-- Include Editor JS files. -->
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/froala-editor/2.6.4/js/froala_editor.pkgd.min.js"></script>
    <!-- Initialize the editor. -->

    <script> $(function() { $('textarea').froalaEditor() }); </script>

    <script src="  asset('js/app.js')  "></script>
    <script src="https://unpkg.com/vue"></script>


好奇问什么有些人需要些vendor/bin/phpunit才ok,我后来在bash里面添加了alias才可以直接写phpunit