npm install
npm run serve
npm run build
npm run lint
...
import { getAuth } from "firebase/auth";
import { getFirestore } from "firebase/firestore";
const db = getFirestore(app);
const auth = getAuth(app);
export { auth, db };
import { collection, addDoc } from "firebase/firestore";
Use:
await addDoc(collection(db, "invoices"), { ... });
OR import { doc, setDoc } from "firebase/firestore";
Use:
await setDoc(doc(db, "invoices", "new-city-id"), { ... });
Ref: https://stackoverflow.com/questions/47474522/firestore-difference-between-set-and-add
updateDoc():
import { doc, updateDoc } from "firebase/firestore";
const invoiceDoc = doc(db, "invoices", docId);
await updateDoc(invoiceDoc, { ... });
setDoc():
while using setDoc(), include
{ merge: true },
after the data { ... }, to merge otherwise its contents will be overwritten with the newly provided data.
Using jsPDF and html2canvas with Vue
import jsPDF from "jspdf";
import html2canvas from "html2canvas";