Skip to content

Commit 015ff83

Browse files
Merge branch 'develop' into carbon
2 parents cdaa51e + a0f61b2 commit 015ff83

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

docs/index.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,17 @@
114114
},
115115
vueComponents: {
116116
'button-counter': {
117-
template: `
118-
<button @click="count += 1">
119-
You clicked me {{ count }} times
120-
</button>
121-
`,
122-
data() {
117+
template:
118+
'<button @click="count += 1">You clicked me {{ count }} times</button>',
119+
data: function() {
123120
return {
124121
count: 0,
125122
};
126123
},
127124
},
128125
},
129126
vueGlobalOptions: {
130-
data() {
127+
data: function() {
131128
return {
132129
count: 0,
133130
message: 'Hello, World!',
@@ -140,7 +137,7 @@
140137
};
141138
},
142139
computed: {
143-
timeOfDay() {
140+
timeOfDay: function() {
144141
const date = new Date();
145142
const hours = date.getHours();
146143

@@ -161,7 +158,7 @@
161158
},
162159
vueMounts: {
163160
'#counter': {
164-
data() {
161+
data: function() {
165162
return {
166163
count: 0,
167164
};
@@ -197,7 +194,10 @@
197194
if (vm.route.path === '/') {
198195
return html;
199196
}
200-
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>`;
197+
return (
198+
html +
199+
'<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>'
200+
);
201201
});
202202
},
203203
],

src/core/render/index.js

Lines changed: 5 additions & 8 deletions
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)