Javascript vue js中的对象HTMLTextAreaElement

Javascript vue js中的对象HTMLTextAreaElement,javascript,php,laravel,vue.js,vuejs2,Javascript,Php,Laravel,Vue.js,Vuejs2,我使用laracasts/utilities laravel包将laravel变量传递给js文件。以下是我在控制器中的代码: JavaScript::put([ 'description' => $room->description ]); 我的vue js代码: var keywordcount = new Vue({ el: "#desc-edit", data: { maxdesc: 160, desc: descrip

我使用laracasts/utilities laravel包将laravel变量传递给js文件。以下是我在控制器中的代码:

        JavaScript::put([
        'description' => $room->description
    ]);
我的vue js代码:

var keywordcount = new Vue({
el: "#desc-edit",
data: {
    maxdesc: 160,
    desc: description
},
computed: {
    descEdit: function() {
        return this.maxdesc - this.desc.length;
    }
 }
});
我正在编辑表单的文本区域中获取输出[object HTMLTextAreaElement]。我尝试了desc:window.description,因为配置文件中列出了'js_namespace'=>'window'

如何获取纯文本输出?

[object HTMLTextAreaElement]是转换为字符串的textarea DOM元素。要获取其文本值,可以向元素添加.value

例如,如果window.description是textarea元素,则window.description.value将为您提供文本值。所以你想要的可能是

data: {
    // ...
    desc: window.description.value
},