HTML 文件:
<script src="./index.js"></script>
javascript 文件:
const axios = require("axios")
async function handlecep(){
const uf = await axios.get("https://servicodados.ibge.gov.br/api/v1/localidades/estados")
const response = await fetch(uf)
const data = await response.jso(response)
console.log(data)
}
handlecep()
答案 0 :(得分:1)
浏览器本身不支持 @staff_member_required
def admin_order_pdf(request, order_id):
order = get_object_or_404(Order, id=order_id)
pdf = open('order.pdf', "w+b")
context = {'order': order}
source_html = render_to_string('pdf.html', context)
pisa.CreatePDF(source_html, dest=pdf)
函数。假设你安装了 Axios(require
),你把它放在你的 npm i axios
标签上方:
<script src="./index.js"></script>
然后使用 Axios,而不使用 <script src="node_modules/axios/dist/axios.min.js"></script>
:
require