Vue
by zhouyulong
HTML
<script src="https://cdn.bootcss.com/axios/0.18.0/axios.js"></script>
<div id="app">
<h2>Phone tree:</h2>
<ul>
<li>
<span>HuaWei</span>
<ol>
<li>
-- nove 3
</li>
</ol>
</li>
<li>
<span>Apple</span>
<ol>
<li>
-- Iphone X
</li>
<li>
-- Iphone 8 plus
</li>
</ol>
</li>
</ul>
</div>
CSS
body {
background: #20262E;
padding: 20px;
font-family: Helvetica;
}
#app {
background: #fff;
border-radius: 4px;
padding: 20px;
transition: all 0.2s;
}
li {
margin: 8px 0;
}
h2 {
font-weight: bold;
margin-bottom: 15px;
}
Vue
/* new Vue({
el: "#app",
data: {
phoneList: []
},
mounted() {
axios.get('https://private-4f7c1-zyl1.apiary-mock.com/questions')
.then(response=> {
console.log(response);
this.phoneList = response.data;
})
.catch(error => {
console.log(error);
});
},
methods: {
}
}) */