EExcel 丞燕快速查詢2

EExcel 丞燕快速查詢2
EExcel 丞燕快速查詢2 https://sandk.ffbizs.com/
顯示具有 nuxt 標籤的文章。 顯示所有文章
顯示具有 nuxt 標籤的文章。 顯示所有文章

nuxt3 build .env !!

You want Build time use .env setting context. Two way:

1. source .env

package.json > "build": "source .env && nuxt build"

2. eval $(grep '^NUXT_' .env)

package.json > "build": "eval $(grep '^PROD_' .env) && nuxt build"

^RROD_ can replace by yourself

.env file inside

PROD_API_URL=https://ooxxooxx

nuxt 3 $fetch x-www-form-urlencode blob

file download


  const pdf = async () => {
    const download_url = new URL("/api/pdf")
    download_url.search = new URLSearchParams({'order_id': '20241101001'}).toString();
    
    try {
      const blob = await $fetch(download_url.toString(), {
        method: 'GET',
        headers: {
          'Content-Type': 'application/x-www-form-urlencoded',
        },
      })
    
      const link = document.createElement('a');
      link.href = URL.createObjectURL(blob);
      link.setAttribute('download', '20241101001.pdf');
      document.body.appendChild(link);
      link.click()

      document.body.removeChild(link);
    } catch (error) {
      console.log(error)
    }
  }
file print


  var iframe = document.createElement('iframe');
  iframe.style.display = 'none';
  iframe.src = url;
  document.body.appendChild(iframe);
  iframe.contentWindow.focus();
  iframe.contentWindow.print();