Fixed #385 - Sort the icons alphabetically in the documentation

pull/411/head
cagataycivici 2020-07-18 15:01:50 +03:00
parent 511cf5bd0c
commit 783883dc33
1 changed files with 15 additions and 2 deletions

View File

@ -58,7 +58,8 @@ npm install primeicons --save
</div> </div>
</div> </div>
</div> </div>
</div></template> </div>
</template>
<script> <script>
import axios from 'axios'; import axios from 'axios';
@ -71,7 +72,19 @@ export default {
} }
}, },
mounted() { mounted() {
axios.get('demo/data/icons.json').then(res => this.icons = res.data.icons); axios.get('demo/data/icons.json').then(res => {
let icons = res.data.icons;
icons.sort((icon1, icon2) => {
if(icon1.properties.name < icon2.properties.name)
return -1;
else if(icon1.properties.name < icon2.properties.name)
return 1;
else
return 0;
});
this.icons = icons;
});
}, },
computed: { computed: {
filteredIcons() { filteredIcons() {