@/utils/utils#shareText JavaScript Examples
The following examples show how to use
@/utils/utils#shareText.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: tools.js From lx-music-mobile with Apache License 2.0 | 6 votes |
shareMusic = (shareType, downloadFileName, musicInfo) => {
const name = musicInfo.name
const singer = musicInfo.singer
const detailUrl = music[musicInfo.source]?.getMusicDetailPageUrl(musicInfo) ?? ''
const musicTitle = downloadFileName.replace('歌名', name).replace('歌手', singer)
switch (shareType) {
case 'system':
shareText(i18n.t('share_card_title_music', { name }), i18n.t('share_title_music'), `${musicTitle.replace(/\s/g, '')} \n${detailUrl}`)
break
case 'clipboard':
clipboardWriteText(`${musicTitle} ${detailUrl}`)
toast(i18n.t('copy_name_tip'))
break
}
}