Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit ab7a205

Browse files
feat: add input
1 parent 86c8fd5 commit ab7a205

File tree

2 files changed

+26
-33
lines changed

2 files changed

+26
-33
lines changed

demo/App.vue

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
</div>
6868

6969
<div class="grid__row icons__list">
70-
70+
7171
<section class="grid__row">
7272
<div class="section__head">
7373
<h2 class="icon__title-section">App Icon</h2>
@@ -77,8 +77,8 @@
7777
</ul>
7878
</div>
7979
<div class="appicon__wrapper" v-if="isMaterial">
80-
<div class="box"
81-
v-for="icon in filteredMdIcons"
80+
<div class="box"
81+
v-for="icon in filteredMdIcons"
8282
:key="icon.name"
8383
@click="activateIcon(icon)">
8484
<component :is="icon.name"
@@ -91,8 +91,8 @@
9191
</div>
9292
</div>
9393
<div class="appicon__wrapper" v-if="isIos">
94-
<div class="box"
95-
v-for="icon in filteredIosIcons"
94+
<div class="box"
95+
v-for="icon in filteredIosIcons"
9696
:key="icon.name"
9797
@click="activateIcon(icon)">
9898
<component :is="icon.name"
@@ -105,14 +105,14 @@
105105
</div>
106106
</div>
107107
</section>
108-
108+
109109
<section class="grid__row">
110110
<div class="section__head">
111111
<h2 class="icon__title-section">Logo Icon</h2>
112112
</div>
113113
<div class="appicon__wrapper">
114-
<div class="box"
115-
v-for="icon in filteredLogoIcons"
114+
<div class="box"
115+
v-for="icon in filteredLogoIcons"
116116
:key="icon.name"
117117
@click="activateIcon(icon)">
118118
<component :is="icon.name"
@@ -134,32 +134,13 @@
134134
<h2>Contribute</h2>
135135
<p>Feel free to fork <i class="fa fa-code-fork"></i> on <a href="https://github.com/mazipan/vue-ionicons" target="_blank">GitHub <i class="fa fa-github"></i></a> if you have any features <i class="fa fa-cart-plus"></i> or bugs <i class="fa fa-bug"></i>!</p>
136136

137-
<h2>Contact Developer</h2>
138-
<p>
139-
<a href="https://github.com/mazipan">
140-
<LogoGithubIcon w="30px" h="30px" />
141-
</a>
142-
<a href="mailto:mazipanneh@gmail.com">
143-
<IosMailIcon w="30px" h="30px" />
144-
</a>
145-
<a href="https://facebook.com/mazipanneh">
146-
<LogoFacebookIcon w="30px" h="30px" />
147-
</a>
148-
<a href="https://twitter.com/Maz_Ipan">
149-
<LogoTwitterIcon w="30px" h="30px" />
150-
</a>
151-
<a href="https://id.linkedin.com/in/irfanmaulanamazipan">
152-
<LogoLinkedinIcon w="30px" h="30px" />
153-
</a>
154-
</p>
155-
156-
<p>Copyright © 2017 <a href="https://mazipanneh.com/blog/">Irfan Maulana</a>, All Rights Reserved.</p>
137+
<p>Copyright © 2017 <a href="https://mazipan.space/">Irfan Maulana</a>, All Rights Reserved.</p>
157138
</footer>
158139

159140
<section
160141
:class="{ 'show' : visibleToast }"
161142
class="toast">
162-
<span>import {{ activeIcon.libraryName }} from 'vue-ionicons/dist/{{ activeIcon.name.replace('-icon', '') }}.vue'</span>
143+
<input :id="`txt-${activeIcon.libraryName}`" type="text" :value="activeIcon.inputValue" />
163144
</section>
164145

165146
</div>
@@ -192,7 +173,8 @@ export default {
192173
activeIcon: {
193174
libraryName: '',
194175
name: '',
195-
readableName: ''
176+
readableName: '',
177+
inputValue: ''
196178
},
197179
visibleToast: false
198180
}
@@ -236,8 +218,19 @@ export default {
236218
}
237219
},
238220
activateIcon (icon) {
239-
this.activeIcon = icon
240-
this.visibleToast = true
221+
this.activeIcon = {
222+
...icon,
223+
inputValue: `import ${icon.libraryName} from 'vue-ionicons/dist/${icon.name.replace('-icon', '')}.vue'`
224+
}
225+
this.visibleToast = true
226+
227+
setTimeout(() => {
228+
var copyText = document.getElementById(`txt-${icon.libraryName}`);
229+
copyText.select();
230+
copyText.setSelectionRange(0, 99999);
231+
document.execCommand("copy");
232+
}, 1000)
233+
241234
setTimeout(() => {
242235
this.visibleToast = false
243236
}, 5000)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-ionicons",
3-
"version": "3.0.4",
3+
"version": "3.0.5",
44
"license": "MIT",
55
"author": "Irfan Maulana (https://github.com/mazipan/)",
66
"description": "Vue Icon Set Components from Ionic Team",

0 commit comments

Comments
 (0)