-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into master_github
- Loading branch information
Showing
3 changed files
with
119 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
Vue.filter('filter_price', function(value) { | ||
if (parseFloat(value) < 1) { | ||
return Intl.NumberFormat('en-US', { | ||
useGrouping: false, | ||
minimumFractionDigits: 2, | ||
maximumFractionDigits: 6 | ||
}).format(value); | ||
} | ||
const options = { | ||
moduleCache: { | ||
vue: Vue | ||
}, | ||
|
||
return Intl.NumberFormat('en-US', { | ||
useGrouping: false, | ||
minimumFractionDigits: 2, | ||
maximumFractionDigits: 2 | ||
}).format(value); | ||
}); | ||
getFile(url) { | ||
return fetch(url).then(response => (response.ok ? response.text() : Promise.reject(response))); | ||
}, | ||
|
||
Vue.filter('round', function(value, decimalPlaces = 0) { | ||
return value.toFixed(decimalPlaces); | ||
}); | ||
addStyle(styleStr) { | ||
const style = document.createElement('style'); | ||
style.textContent = styleStr; | ||
const ref = document.head.getElementsByTagName('style')[0] || null; | ||
document.head.insertBefore(style, ref); | ||
}, | ||
|
||
Vue.filter('date', function(value) { | ||
return new Date(value).toLocaleString(); | ||
}); | ||
log(type, ...args) { | ||
console.log(type, ...args); | ||
} | ||
}; | ||
|
||
const { loadModule, version } = window['vue3-sfc-loader']; | ||
|
||
new Vue({ | ||
el: '#vue-trades', | ||
const app = Vue.createApp({ | ||
components: { | ||
'trades': httpVueLoader('js/trades.vue') | ||
} | ||
'my-component': Vue.defineAsyncComponent(() => loadModule('./js/trades.vue', options)) | ||
}, | ||
template: `<my-component></my-component>` | ||
}); | ||
|
||
app.mount('#vue-trades'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters