Refactor from Vue2 to Vue3 (#20044)

Close #19902
This commit is contained in:
André Jaenisch 2022-10-01 16:26:38 +02:00 committed by GitHub
parent 726afe8a9e
commit 04e97b8311
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 384 additions and 606 deletions

View file

@ -1,4 +1,4 @@
import Vue from 'vue';
import {createApp} from 'vue';
import ActivityHeatmap from '../components/ActivityHeatmap.vue';
export default function initHeatmap() {
@ -17,11 +17,9 @@ export default function initHeatmap() {
return {date: new Date(v), count: heatmap[v]};
});
const View = Vue.extend({
render: (createElement) => createElement(ActivityHeatmap, {props: {values}}),
});
const View = createApp(ActivityHeatmap, {values});
new View().$mount(el);
View.mount(el);
} catch (err) {
console.error('Heatmap failed to load', err);
el.textContent = 'Heatmap failed to load';