【发布时间】:2018-06-06 18:41:09
【问题描述】:
更新
好的。经过大量搜索 Vue 渲染不是我的问题。 dataTables 服务器端将转义 html 转换成这样
"image": "<a target="_blank" href="media/test/img1.jpg">show</a>"
老问题!
我知道 v-html,但我的问题是当我想渲染动态表(来自 dataTables)时。
http://yajrabox.com/docs/laravel-datatables/master/.
我如何告诉 vue 渲染 html?是否有一些全局选项可以做到这一点?
我的桌子:
<table class="table table-hover table-bordered table-striped" id="table_id" ></table>
我的 js:
self.dataTableSet = $('#table_id').on('preXhr.dt', function ( ) {
self.$Progress.start();
} ).DataTable({
columns: columns,
order: [[ count, 'desc' ]],
"processing": true,
"serverSide": true,
"ajax": {
'type': 'get',
'url': axios.defaults.baseURL+"tests/get_data_table",
headers: {'X-CSRF-TOKEN': axios.defaults.headers.common['X-CSRF-TOKEN'],'Authorization':this.$auth.getToken()},
data: function ( d ) {
d.advance_search = self.adv_search_form;
// d.from_date = sorting_from_date.val();
}
},
"drawCallback": function( ) {
self.$Progress.finish();
}
});
【问题讨论】:
-
我使用vue里面的mounted方法来渲染Datatables
-
好的。经过大量搜索 Vue 渲染不是我的问题。 dataTables 服务器端将转义 html 转换成这样:“<a target="_blank" href="media/test/img1.jpg">show</a&g
标签: javascript laravel vue.js datatables vuejs2