Skip to content

Commit 406789c

Browse files
committed
Update examples.
1 parent 8ed44c0 commit 406789c

File tree

6 files changed

+39
-38
lines changed

6 files changed

+39
-38
lines changed

examples/.prettierrc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
{
2-
"tabWidth": 2,
3-
"useTabs": false,
4-
"printWidth": 120,
5-
"singleQuote": true,
6-
"semi": true
7-
}
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"printWidth": 120,
5+
"singleQuote": true,
6+
"semi": true,
7+
"trailingComma": "none"
8+
}

examples/package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,30 @@
1111
},
1212
"main": "dist/index.html",
1313
"dependencies": {
14-
"@jhuix/vue-showdowns-editor": "^1.0.2",
15-
"axios": "^0.19.0",
16-
"core-js": "^3.4.8",
17-
"vue": "^2.6.10",
18-
"vue-router": "^3.1.3",
19-
"vuex": "^3.1.2"
14+
"@jhuix/vue-showdowns-editor": "^1.0.4",
15+
"axios": "^0.20.0",
16+
"core-js": "^3.6.5",
17+
"vue": "^2.6.12",
18+
"vue-router": "^3.4.7",
19+
"vuex": "^3.5.1"
2020
},
2121
"devDependencies": {
2222
"@jhuix/style-resources-loader": "^1.3.4",
23-
"@vue/cli-plugin-babel": "^4.1.1",
24-
"@vue/cli-plugin-eslint": "^4.1.1",
25-
"@vue/cli-plugin-router": "^4.1.1",
26-
"@vue/cli-plugin-vuex": "^4.1.1",
27-
"@vue/cli-service": "^4.1.1",
23+
"@vue/cli-plugin-babel": "^4.5.7",
24+
"@vue/cli-plugin-eslint": "^4.5.7",
25+
"@vue/cli-plugin-router": "^4.5.7",
26+
"@vue/cli-plugin-vuex": "^4.5.7",
27+
"@vue/cli-service": "^4.5.7",
2828
"@vue/eslint-config-prettier": "^6.0.0",
29-
"autoprefixer": "^9.7.3",
30-
"babel-eslint": "^10.0.3",
31-
"eslint": "^5.16.0",
32-
"eslint-plugin-prettier": "^3.1.1",
33-
"eslint-plugin-vue": "^5.0.0",
34-
"prettier": "^1.19.1",
35-
"stylus": "^0.54.7",
29+
"autoprefixer": "^10.0.1",
30+
"babel-eslint": "^10.1.0",
31+
"eslint": "^7.11.0",
32+
"eslint-plugin-prettier": "^3.1.4",
33+
"eslint-plugin-vue": "^7.0.1",
34+
"prettier": "^2.1.2",
35+
"stylus": "^0.54.8",
3636
"stylus-loader": "^3.0.2",
37-
"vue-template-compiler": "^2.6.10"
37+
"vue-template-compiler": "^2.6.12"
3838
},
3939
"browserslist": [
4040
"> 0.2%",

examples/src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ Vue.config.productionTip = false;
1616
new Vue({
1717
store,
1818
router,
19-
render: h => h(App)
19+
render: (h) => h(App)
2020
}).$mount('#app');

examples/src/views/mainview.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
:markdown="mdDoc"
1111
:locale="locale"
1212
:previewExtensions="previewExtensions"
13-
@toolClick="handlerToolClick"
14-
@localeChanged="handlerLocaleChanged"
13+
@tool-click="handlerToolClick"
14+
@locale-changed="handlerLocaleChanged"
1515
ref="mdse"
1616
></mdse-showdowns-editor>
1717
</template>
@@ -177,20 +177,20 @@ export default {
177177
}
178178
console.log(`the app locale is ${this.locale} and theme is ${this.theme}!`);
179179
180-
this.$nextTick(function() {
180+
this.$nextTick(function () {
181181
this.$refs.mdse.addOutsideMenu(getOutsideMenu);
182182
this.$refs.mdse.setEditorTheme(this.theme);
183183
let that = this;
184184
var defHtml = axios.get('https://jhuix.github.io/showdowns/showdowns-features.md');
185185
defHtml
186-
.then(function(res) {
186+
.then(function (res) {
187187
that.mdDoc = res.data;
188188
return axios.get("https://jhuix.github.io/showdowns/Showdown's-Markdown-syntax.md");
189189
})
190-
.then(function(res) {
190+
.then(function (res) {
191191
that.mdDoc = that.mdDoc + '\n\n' + res.data;
192192
})
193-
.catch(function(error) {
193+
.catch(function (error) {
194194
console.log(error);
195195
});
196196
});

examples/src/views/preview.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default {
2020
const content = JSON.parse(zlibcodec.zDecode(zcontent));
2121
this.outputHtml = content.html;
2222
if (content.cssLinks) {
23-
content.cssLinks.map(href => {
23+
content.cssLinks.map((href) => {
2424
const head = document.head || document.getElementsByTagName('head')[0];
2525
var link = document.createElement('link');
2626
link.rel = 'stylesheet';
@@ -29,7 +29,7 @@ export default {
2929
});
3030
}
3131
if (content.cssStyles) {
32-
content.cssStyles.map(css => {
32+
content.cssStyles.map((css) => {
3333
const head = document.head || document.getElementsByTagName('head')[0];
3434
let style = document.createElement('style');
3535
head.appendChild(style);

examples/vue.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ module.exports = {
3434
}
3535
}
3636
},
37-
chainWebpack: config => {
37+
chainWebpack: (config) => {
3838
const types = ['vue-modules', 'vue', 'normal-modules', 'normal'];
39-
types.forEach(type => addStyleResource(config.module.rule('stylus').oneOf(type)));
39+
types.forEach((type) => addStyleResource(config.module.rule('stylus').oneOf(type)));
4040
},
4141

4242
// 是否为 Babel 或 TypeScript 使用 thread-loader
@@ -50,7 +50,7 @@ function addStyleResource(rule) {
5050
.options({
5151
test: /mainview/,
5252
patterns: [],
53-
injector: function(source, resources) {
53+
injector: function (source, resources) {
5454
return `@import '../../node_modules/@jhuix/vue-showdowns-editor/dist/lib/vue-mdse.css';\n${source.trim()}`;
5555
}
5656
});

0 commit comments

Comments
 (0)