Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
f7ec0f1c
Unverified
Commit
f7ec0f1c
authored
Sep 16, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using vuejs i18n translate method
parent
a259f5e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
41 deletions
+6
-41
PageTable.vue
Modules/Page/Assets/js/components/PageTable.vue
+2
-4
app.js
public/js/app.js
+4
-37
No files found.
Modules/Page/Assets/js/components/PageTable.vue
View file @
f7ec0f1c
...
...
@@ -6,7 +6,7 @@
<data-tables
:data=
"data"
:actions-def=
"actionsDef"
>
<el-table-column
prop=
"id"
label=
"Id"
width=
"100"
>
</el-table-column>
<el-table-column
prop=
"title"
:label=
"
translate('page', '
title')"
>
<el-table-column
prop=
"title"
:label=
"
$t('page.
title')"
>
</el-table-column>
<el-table-column
prop=
"slug"
label=
"Slug"
>
</el-table-column>
...
...
@@ -30,12 +30,10 @@
<
script
>
import
axios
from
'
axios
'
import
Translate
from
'
../../../../Core/Assets/js/mixins/Translate
'
let
data
;
export
default
{
mixins
:
[
Translate
],
data
()
{
return
{
data
,
...
...
@@ -44,7 +42,7 @@
links
:
{},
actionsDef
:
{
def
:
[{
name
:
this
.
translate
(
'
page
'
,
'
create
page
'
),
name
:
this
.
$t
(
'
page.create-
page
'
),
icon
:
'
edit
'
,
handler
:
()
=>
{
this
.
$router
.
push
({
name
:
'
admin.page.page.create
'
})
...
...
public/js/app.js
View file @
f7ec0f1c
...
...
@@ -11117,33 +11117,7 @@ module.exports = function ( delay, atBegin, callback ) {
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = {
data: function data() {
return {
translations: {}
};
},
methods: {
translate: function translate(namespace, name) {
return _.get(this.translations[namespace], name);
}
},
mounted: function mounted() {
this.translations = window.AsgardCMS.translations;
}
};
/***/ }),
/* 10 */,
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
...
...
@@ -70570,13 +70544,9 @@ var _axios = __webpack_require__(8);
var _axios2 = _interopRequireDefault(_axios);
var _Translate = __webpack_require__(10);
var _Translate2 = _interopRequireDefault(_Translate);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
//
var _data = void 0;
//
//
//
//
...
...
@@ -70607,10 +70577,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
//
//
var _data = void 0;
exports.default = {
mixins: [_Translate2.default],
data: function data() {
var _this = this;
...
...
@@ -70621,7 +70588,7 @@ exports.default = {
links: {},
actionsDef: {
def: [{
name: this.
translate('page', 'create
page'),
name: this.
$t('page.create-
page'),
icon: 'edit',
handler: function handler() {
_this.$router.push({ name: 'admin.page.page.create' });
...
...
@@ -71735,7 +71702,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
}), _vm._v(" "), _c('el-table-column', {
attrs: {
"prop": "title",
"label": _vm.
translate('page', '
title')
"label": _vm.
$t('page.
title')
}
}), _vm._v(" "), _c('el-table-column', {
attrs: {
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment