fix: use v-html for svg icons

This commit is contained in:
Shariq Ansari 2022-10-26 19:37:32 +05:30
parent 3f3bf04395
commit 2b381f284d
4 changed files with 10 additions and 22 deletions

View file

@ -67,14 +67,10 @@ watch(
class="btn btn-xs btn-icon"
@click="edit_html"
>
<svg class="icon icon-sm">
<use href="#icon-edit"></use>
</svg>
<div v-html="frappe.utils.icon('edit', 'sm')"></div>
</button>
<button class="btn btn-xs btn-icon" @click="remove_field">
<svg class="icon icon-sm">
<use href="#icon-close"></use>
</svg>
<div v-html="frappe.utils.icon('close', 'sm')"></div>
</button>
</div>
</div>
@ -143,7 +139,7 @@ watch(
padding: 2px;
&:hover {
background-color: white;
background-color: var(--fg-color);
}
}
}

View file

@ -9,9 +9,7 @@
@input="event => $emit('update:modelValue', event.target.value)"
/>
<span class="search-icon">
<svg class="icon icon-sm">
<use href="#icon-search"></use>
</svg>
<div v-html="frappe.utils.icon('search', 'sm')"></div>
</span>
</div>
</template>

View file

@ -131,9 +131,7 @@ let section_options = computed(() => {
class="btn btn-xs btn-section dropdown-button"
data-toggle="dropdown"
>
<svg class="icon icon-sm">
<use href="#icon-dot-horizontal"></use>
</svg>
<div v-html="frappe.utils.icon('dot-horizontal', 'sm')"></div>
</button>
<div class="dropdown-menu dropdown-menu-right" role="menu">
<button

View file

@ -146,13 +146,11 @@ function remove_tab() {
<div class="tab-actions" :hidden="store.read_only">
<button
class="new-tab-btn btn btn-xs"
:class="{ 'no-tabs' : !has_tabs }"
:class="{ 'no-tabs': !has_tabs }"
:title="__('Add new tab')"
@click="add_new_tab()"
@click="add_new_tab"
>
<svg class="icon icon-sm" v-if="has_tabs">
<use href="#icon-add"></use>
</svg>
<div v-if="has_tabs" v-html="frappe.utils.icon('add', 'sm')"></div>
<div class="add-btn-text" v-else>
{{ __("Add new tab") }}
</div>
@ -161,11 +159,9 @@ function remove_tab() {
v-if="has_tabs"
class="remove-tab-btn btn btn-xs"
:title="__('Remove selected tab')"
@click="remove_tab()"
@click="remove_tab"
>
<svg class="icon icon-sm">
<use href="#icon-close"></use>
</svg>
<div v-html="frappe.utils.icon('close', 'sm')"></div>
</button>
</div>
</div>