Last active
June 5, 2018 12:45
-
-
Save ndabAP/e7f13dd4a2ee6f33574484475925c95e to your computer and use it in GitHub Desktop.
Vue.js case
This file contains hidden or 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
// It might be that you need components loaded dynamically. You can use the following function | |
const getComponentName = (identifier, method = 'post') => { | |
return `${identifier.replace(/([A-Z])/g, '-$1').toLowerCase().replace(/^-(.*)$/, '$1')}-${method}` | |
} | |
// Example: getComponentName('PriceTable', 'get') yields 'price-table-get' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment