Skip to content
This repository was archived by the owner on Mar 29, 2023. It is now read-only.

Commit ce21df8

Browse files
committed
Fixed #35 // Released Version 1.12
1 parent 8b5a69b commit ce21df8

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "office-vue-fabric",
3-
"version": "0.1.11",
3+
"version": "0.1.12",
44
"private": false,
55
"main": "dist/office-vue-fabric.umd.min.js",
66
"license": "MIT",

packages/icons/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@ import { initializeIcons as i16 } from "./fabric-icons-16";
2020

2121
import { registerIconAliases } from "./iconAliases";
2222
const DEFAULT_BASE_URL = "https://spoprod-a.akamaihd.net/files/fabric/assets/icons/";
23+
let isInitialized = false;
2324

2425
export function initializeIcons(baseUrl: string = DEFAULT_BASE_URL, options?: IIconOptions): void {
2526
[i, i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16].forEach(
2627
(initialize: (url: string, options?: IIconOptions) => void) => initialize(baseUrl, options)
2728
);
2829

2930
registerIconAliases();
31+
isInitialized = true;
32+
}
33+
34+
export function areIconsInitialized(): boolean {
35+
return isInitialized;
3036
}
3137

3238
export { IconNames } from "./IconNames";

packages/office-ui-fabric-vue/components/Icon/OfficeIcon.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,25 @@
33
</template>
44

55
<script lang="ts">
6+
import {areIconsInitialized, initializeIcons} from "@icons/index";
67
import {getStyles} from "./OfficeIcon.styles";
78
import {IconType, IOfficeIconProps} from "./OfficeIcon.types";
89
import OfficeImage from "../Image/OfficeImage.vue";
910
import {getIcon} from "@styling/utilities/icons";
1011
import {mergeStyleSets} from "@uifabric/merge-styles";
1112
import {Component, Prop, Vue} from "vue-property-decorator";
1213
14+
if(!areIconsInitialized())
15+
initializeIcons();
16+
1317
@Component({
1418
components: {OfficeImage}
1519
})
1620
export default class OfficeIcon extends Vue implements IOfficeIconProps {
1721
@Prop({type: Number, default: IconType.default}) public iconType!: IconType;
1822
@Prop({type: String, default: ""}) public iconName!: string;
1923
20-
private children: string | null | undefined = null;
24+
private children?: string | null = null;
2125
2226
private get rootType() {
2327
return this.isImage ? "div" : "i";

0 commit comments

Comments
 (0)