Skip to content

Commit 5f23218

Browse files
committed
avoid using vue runtime compiler
1 parent 744c8c6 commit 5f23218

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

web_src/js/components/DashboardRepoList.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<li v-for="repo in repos" :class="{'private': repo.private || repo.internal}" :key="repo.id">
7474
<a class="repo-list-link gt-df gt-ac gt-sb" :href="repo.link">
7575
<div class="item-name gt-df gt-ac gt-f1 gt-mr-2">
76-
<svg-icon :name="repoIcon(repo)" size="16" class-name="gt-mr-2"/>
76+
<svg-icon :name="repoIcon(repo)" :size="16" class-name="gt-mr-2"/>
7777
<div class="text gt-bold truncate gt-ml-1">{{ repo.full_name }}</div>
7878
<span v-if="repo.archived">
7979
<svg-icon name="octicon-archive" :size="16" class-name="gt-ml-2"/>

web_src/js/svg.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {h} from 'vue';
12
import octiconChevronDown from '../../public/img/svg/octicon-chevron-down.svg';
23
import octiconChevronRight from '../../public/img/svg/octicon-chevron-right.svg';
34
import octiconClock from '../../public/img/svg/octicon-clock.svg';
@@ -90,7 +91,9 @@ const svgs = {
9091
'octicon-git-branch': octiconGitBranch,
9192
};
9293

93-
// TODO: use a more general approach to access SVG icons. At the moment, developers must check, pick and fill the names manually, most of the SVG icons in assets couldn't be used directly.
94+
// TODO: use a more general approach to access SVG icons.
95+
// At the moment, developers must check, pick and fill the names manually,
96+
// most of the SVG icons in assets couldn't be used directly.
9497

9598
const parser = new DOMParser();
9699
const serializer = new XMLSerializer();
@@ -116,12 +119,7 @@ export const SvgIcon = {
116119
size: {type: Number, default: 16},
117120
className: {type: String, default: ''},
118121
},
119-
120-
computed: {
121-
svg() {
122-
return svg(this.name, this.size, this.className);
123-
},
122+
render() {
123+
return h('span', {innerHTML: svg(this.name, this.size, this.className)});
124124
},
125-
126-
template: `<span v-html="svg" />`
127125
};

0 commit comments

Comments
 (0)