Guest User

Untitled

a guest
Jun 20th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.26 KB | None | 0 0
  1. <template>
  2. <div class="container">
  3. <br>
  4. <form class="form-inline" action="POST" v-on:submit.prevent>
  5. <table>
  6. <tr>
  7. <td style="font-weight:bold; width:200px;">Exchange</td>
  8. <td style="width:250px;">
  9. <input class="form-check-input"
  10. type="radio"
  11. id="bittrex"
  12. name="bittrex"
  13. value="bittrex"
  14. v-model="queryExchange.picked"/> &nbsp;Bittrex
  15. <input class="form-check-input"
  16. type="radio"
  17. id="binnace"
  18. name="binance"
  19. value="binance"
  20. v-model="queryExchange.picked"
  21. checked> &nbsp;Binance
  22. </td>
  23.  
  24. </tr>
  25. <tr><td colspan="4" style="height:20px"></td></tr>
  26. <tr>
  27. <td style="font-weight:bold; width:200px;">Intervalo:</td>
  28. <td>
  29. <select id="Intervalo" name="Intervalo" v- model="queryExchange.interval">
  30. <option value="W">1 Semana</option>
  31. <option value="D">1 Día</option>
  32. <option value="240">4 Hrs</option>
  33. <option value="60">1 Hr</option>
  34. <option value="30">30 min</option>
  35. <option value="15">15 min</option>
  36. <option value="5">5 min</option>
  37. </select>
  38. </td>
  39. </tr>
  40. <tr><td colspan="4" style="height:20px"></td></tr>
  41. <tr>
  42. <td style="font-weight:bold; width:200px;">
  43. <button type="button" class="btn btn-primary"
  44. v-on:click="queryForm()">
  45. Mostrar
  46. </button>
  47. </td>
  48. </tr>
  49. <tr><td colspan="4" style="height:20px"></td></tr>
  50. </table>
  51. </form>
  52. <div id="contenedor"></div>
  53. </div>
  54.  
  55. <script>
  56. export default {
  57. data () {
  58. return {
  59. queryExchange: {
  60. picked: 'binance',
  61. interval: '60',
  62. },
  63. cryptoCurrency: ['BTC', 'ETH', 'EOS', 'XRP']
  64. }
  65. },
  66. methods: {
  67. queryForm(){
  68. let exchangeSelect = this.queryExchange.picked.toUpperCase();
  69. let intervalSelect = this.queryExchange.interval;
  70. this.cryptoCurrency.forEach(element => {
  71. new TradingView.widget(
  72. {
  73. "width": 400,
  74. "height": 300,
  75. "symbol": exchangeSelect+':'+element+'BTC',
  76. "interval": intervalSelect,
  77. "timezone": "Etc/UTC",
  78. "theme": "Dark",
  79. "style": "1",
  80. "locale": "en",
  81. "toolbar_bg": "#f1f3f6",
  82. "allow_symbol_change": true,
  83. "enable_publishing": false,
  84. "save_image": false,
  85. "hideideas": true,
  86. "container_id": "contenedor"
  87. }
  88. );
  89. });
  90. }
  91. }
  92. }
  93. </script>
Add Comment
Please, Sign In to add comment