Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template>
- <div id="app">
- <input v-model="x" @keyup.enter="f()">
- <br>
- <li v-for="(elem,i) in t" v-html="elem" :key="i"/>
- </div>
- </template>
- <script>
- export default {
- name: "App",
- data() {
- return {
- x: 1,
- t: []
- };
- },
- methods: {
- f() {
- this.t.push(this.x);
- this.t.sort((a, b) => a.localeCompare(b));
- this.x = "";
- }
- }
- };
- </script>
- <style>
- #app {
- font-size: 20px;
- }
- </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement