Skip to content

Commit dd6dba3

Browse files
Merge branch 'develop' into fix-ie11-theme-switcher
2 parents 0b0aab7 + a0f61b2 commit dd6dba3

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

Diff for: docs/index.html

+10-10
Original file line numberDiff line numberDiff line change
@@ -113,20 +113,17 @@
113113
},
114114
vueComponents: {
115115
'button-counter': {
116-
template: `
117-
<button @click="count += 1">
118-
You clicked me {{ count }} times
119-
</button>
120-
`,
121-
data() {
116+
template:
117+
'<button @click="count += 1">You clicked me {{ count }} times</button>',
118+
data: function() {
122119
return {
123120
count: 0,
124121
};
125122
},
126123
},
127124
},
128125
vueGlobalOptions: {
129-
data() {
126+
data: function() {
130127
return {
131128
count: 0,
132129
message: 'Hello, World!',
@@ -139,7 +136,7 @@
139136
};
140137
},
141138
computed: {
142-
timeOfDay() {
139+
timeOfDay: function() {
143140
const date = new Date();
144141
const hours = date.getHours();
145142

@@ -160,7 +157,7 @@
160157
},
161158
vueMounts: {
162159
'#counter': {
163-
data() {
160+
data: function() {
164161
return {
165162
count: 0,
166163
};
@@ -195,7 +192,10 @@
195192
if (vm.route.path === '/') {
196193
return html;
197194
}
198-
return `${html}<br/> <i>Vercel</i> has given us a Pro account <br/> <a href="https://vercel.com/?utm_source=docsifyjsdocs" target="_blank"><img src="_media/vercel_logo.svg" alt="Vercel" width="100" height="64"></a>`;
195+
return (
196+
html +
197+
'<br/> <i>Vercel</i> has given us a Pro account <br/> <a href="https://vercel.com/?utm_source=docsifyjsdocs" target="_blank"><img src="_media/vercel_logo.svg" alt="Vercel" width="100" height="64"></a>'
198+
);
199199
});
200200
},
201201
],

Diff for: src/core/render/index.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { callHook } from '../init/lifecycle';
77
import { getAndActive, sticky } from '../event/sidebar';
88
import { getPath, isAbsolutePath } from '../router/util';
99
import { isMobile, inBrowser } from '../util/env';
10-
import { isPrimitive } from '../util/core';
10+
import { isPrimitive, merge } from '../util/core';
1111
import { scrollActiveSidebar } from '../event/scroll';
1212
import { Compiler } from './compiler';
1313
import * as tpl from './tpl';
@@ -116,10 +116,10 @@ function renderMain(html) {
116116

117117
// vueMounts
118118
vueMountData.push(
119-
...Object.entries(docsifyConfig.vueMounts || {})
120-
.map(([cssSelector, vueConfig]) => [
119+
...Object.keys(docsifyConfig.vueMounts || {})
120+
.map(cssSelector => [
121121
dom.find(markdownElm, cssSelector),
122-
vueConfig,
122+
docsifyConfig.vueMounts[cssSelector],
123123
])
124124
.filter(([elm, vueConfig]) => elm)
125125
);
@@ -169,10 +169,7 @@ function renderMain(html) {
169169
})
170170
.map(elm => {
171171
// Clone global configuration
172-
const vueConfig = Object.assign(
173-
{},
174-
docsifyConfig.vueGlobalOptions || {}
175-
);
172+
const vueConfig = merge({}, docsifyConfig.vueGlobalOptions || {});
176173

177174
// Replace vueGlobalOptions data() return value with shared data object.
178175
// This provides a global store for all Vue instances that receive

0 commit comments

Comments
 (0)