index.js 629 B

1234567891011121314151617181920
  1. import { createApp, h } from 'vue';
  2. export function isPromise(obj) {
  3. return Object.prototype.toString.call(obj) === '[object Promise]';
  4. }
  5. export const innerComopnent = (components, options, targetElement) => {
  6. const app = createApp(h(components), options);
  7. app.mount(targetElement);
  8. }
  9. export const isMobile = () => {
  10. // 获取URL中的查询字符串
  11. const queryString = window.location.href;
  12. // 使用URLSearchParams解析查询字符串
  13. const urlParams = new URLSearchParams(queryString);
  14. // 获取特定参数的值
  15. const isMobile = urlParams.get('isMobile');
  16. return isMobile && isMobile === 'true';
  17. }