File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ You can add custom components, save callback.
57
57
| Props | Type | Description |
58
58
| -------- | -------- | -------- |
59
59
| value | ` Object ` | Editor initial value, you can pass the value of the save callback and resume the draft |
60
+ | locale | ` String ` | Editor default locale. Now support 'cn' and 'en', default 'cn'. |
60
61
| widgets | ` Object ` | Vue Components. Custom components for editor. see [ Example] ( https://github.com/fireyy/vue-page-designer-widgets/blob/master/src/index.js ) |
61
62
| save | ` (data) => void ` | When you click the Save button, feed back to you to save the data |
62
63
| upload | ` (files) => Promise ` | Editor upload function, allowing you to implement your own upload-file's request |
@@ -102,6 +103,16 @@ export default {
102
103
</script >
103
104
```
104
105
106
+ Set locale to EN
107
+
108
+ ``` html
109
+ <template >
110
+ <div id =" app" >
111
+ <vue-page-designer locale =" en" />
112
+ </div >
113
+ </template >
114
+ ```
115
+
105
116
## Parameter: ` save `
106
117
107
118
``` html
Original file line number Diff line number Diff line change 5
5
:widgets =" widgets"
6
6
:upload =" handleUpload"
7
7
:upload-option =" uploadOption"
8
+ locale =" cn"
8
9
@save =" handleSave" />
9
10
</div >
10
11
</template >
Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ export default {
56
56
mixins: [vpd],
57
57
props: {
58
58
value: Object ,
59
+ locale: {
60
+ type: String ,
61
+ default: ' cn'
62
+ },
59
63
widgets: Object ,
60
64
upload: Function ,
61
65
uploadOption: Object
@@ -71,6 +75,8 @@ export default {
71
75
loadSprite (' //unpkg.com/vue-page-designer@0.7.1/dist/icons.svg' , ' svgspriteit' )
72
76
},
73
77
created () {
78
+ // 默认语言切换
79
+ i18n .locale = this .locale
74
80
// 注册 widgets
75
81
Vue .use (widget, {
76
82
widgets: this .widgets
You can’t perform that action at this time.
0 commit comments