Posts

Showing posts with the label Cryptocurrency

[SPA Tutorial : Vue.js] Part3 : Control News data - More button

Image
Step 1: News - More Tiếp nối nội dung đã được xây dựng ở Part2 , lần này chúng ta sẽ thêm tính năng xử lý với button Xem thêm (More). Cú pháp chính Cryptocurrency.vue // HTML template syntax <article> <div class="h_area"> <h2>Recent News</h2> </div> <ul> <li v-for="item in news" :key="item.id"> <a :href="item.url"> <div class="bx_thumb"> <img :src="item.imageurl" width="60" height="60" :alt="item.body"> </div> <dl> <dt>[{{item.published_on | moment}}] {{item.title}} </dt> <dd> <p>{{item.body}}</p> </dd> </dl> </a> </li> </ul> ...

[SPA Tutorial : Vue.js] Part2 : Gọi data API sử dụng Axios - Ratio, News

Image
Step 1: Ratio Tiếp nối nội dung đã được xây dựng ở Part1 , lần này chúng ta sẽ thêm data lượng giao dịch 24 giờ. Vì data giá (PRICE) và data tỷ lệ biến động 24 giờ (CHANGEPCT24HOUR) của data phản hồi API ở trong cùng một node nên sẽ tham khảo code xây dựng PRICE và thêm code vào. Nếu sử dụng Finder để tìm kiếm và trực quan hóa JSON Path phức tạp thì việc tạo code sẽ thuận lợi hơn. Cú pháp chính Cryptocurrency.vue // ① HTML 템플릿 구문 <tr> <td>{{cryptoPrice.BTC}}</td> <td>{{cryptoPrice.ETH}}</td> <td>{{cryptoPrice.XRP}}</td> </tr> <tr> <td>{{cryptoRatio.BTC}}</td> <td>{{cryptoRatio.ETH}}</td> <td>{{cryptoRatio.XRP}}</td> </tr> // ② 데이터 객체 data() { return { cryptoPrice: { BTC: 0, ETH: 0, XRP: 0 }, cryptoRatio: { BTC: 0, ETH: 0, XRP: 0 } } }, // ③ ...

[SPA Tutorial : Vue.js] Part1 : Project setting, gọi data API sử dụng Axios - Price

Image
Step 1: Project Setting [Ready] Node.js , Vue CLI phải được cài đặt đúng với OS của môi trường tiến hành. Tạo một dự án dựa trên phiên bản mới nhất của Vue CLI. (cài đặt Vue CLI) Tham khảo các cài đặt bên dưới và tiến hành cài đặt Preset bằng Manual Mode. vue create live-cryptocurrency Vue CLI v3.3.0 ┌───────────────────────────┐ │ Update available: 3.7.0 │ └───────────────────────────┘ ? Please pick a preset: Manually select features ? Check the features needed for your project: Babel, Router, CSS Pre-processors, Linter ? Use history mode for router? (Requires proper server setup for index fallback in production) No ? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Sass/SCSS ? Pick a linter / formatter config: Basic ? Pick additional lint features: (Press <space> to select, <a> to toggle all, <i> to invert selection)Lint on save ? Where do you prefer placing config for Babel, PostCSS, ESLint, etc.? In dedicated ...