From 1351d3fc835ade8a3a26df7d38af43cf9986f995 Mon Sep 17 00:00:00 2001 From: John Hildenbiddle Date: Mon, 8 Feb 2021 15:36:43 -0600 Subject: [PATCH 1/2] Remove ES6 syntax for IE11 compatibility --- docs/index.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/index.html b/docs/index.html index 4ff52e8ee..20f2dd08b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -113,12 +113,9 @@ }, vueComponents: { 'button-counter': { - template: ` - - `, - data() { + template: + '', + data: function() { return { count: 0, }; @@ -126,7 +123,7 @@ }, }, vueGlobalOptions: { - data() { + data: function() { return { count: 0, message: 'Hello, World!', @@ -139,7 +136,7 @@ }; }, computed: { - timeOfDay() { + timeOfDay: function() { const date = new Date(); const hours = date.getHours(); @@ -160,7 +157,7 @@ }, vueMounts: { '#counter': { - data() { + data: function() { return { count: 0, }; @@ -195,7 +192,10 @@ if (vm.route.path === '/') { return html; } - return `${html}
Vercel has given us a Pro account
Vercel`; + return ( + html + + '
Vercel has given us a Pro account
Vercel' + ); }); }, ], From 8f04f9a47e8ba02714612eb9854824a9bfe16d75 Mon Sep 17 00:00:00 2001 From: John Hildenbiddle Date: Mon, 8 Feb 2021 15:38:32 -0600 Subject: [PATCH 2/2] Replace unsupported methods (IE11) --- src/core/render/index.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/core/render/index.js b/src/core/render/index.js index 9e7b50fbd..9fb777baf 100644 --- a/src/core/render/index.js +++ b/src/core/render/index.js @@ -7,7 +7,7 @@ import { callHook } from '../init/lifecycle'; import { getAndActive, sticky } from '../event/sidebar'; import { getPath, isAbsolutePath } from '../router/util'; import { isMobile, inBrowser } from '../util/env'; -import { isPrimitive } from '../util/core'; +import { isPrimitive, merge } from '../util/core'; import { scrollActiveSidebar } from '../event/scroll'; import { Compiler } from './compiler'; import * as tpl from './tpl'; @@ -116,10 +116,10 @@ function renderMain(html) { // vueMounts vueMountData.push( - ...Object.entries(docsifyConfig.vueMounts || {}) - .map(([cssSelector, vueConfig]) => [ + ...Object.keys(docsifyConfig.vueMounts || {}) + .map(cssSelector => [ dom.find(markdownElm, cssSelector), - vueConfig, + docsifyConfig.vueMounts[cssSelector], ]) .filter(([elm, vueConfig]) => elm) ); @@ -169,10 +169,7 @@ function renderMain(html) { }) .map(elm => { // Clone global configuration - const vueConfig = Object.assign( - {}, - docsifyConfig.vueGlobalOptions || {} - ); + const vueConfig = merge({}, docsifyConfig.vueGlobalOptions || {}); // Replace vueGlobalOptions data() return value with shared data object. // This provides a global store for all Vue instances that receive