MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALAR UNIVERSETUTI
MALUMOTLAR BAZASI
2-MUSTAQIL ISH
Bajardi 315-21 guruh talabadsi Abdunazarov Ravshan
REJA : - Kirish
- Asosiy qism
- Malumotlar bazasini dasturlash tili bilan bog’lash
- Malumotlar bazasidan malumotlarni userga ko’rsatish
- Malumotlar bazasiga malumot qo’shish
- Malumotlarni tahrirlash
- Malumotlarni o’chirish
- Xulosa
- Foydalanilgan adabiyotlar
Kirish - Ushbu mustaqil ishda database sifatida 3-tomon databasedan ya’ni Json serverda foydalanildi Malumotlar bazasi Javascriptning Vue js framervorki yordamida bog’landi
- Dastavval dasturni ishga tushiramiz va unda json sereverni o’rnatamiz
- npx run json-server –watch data/db.json
Dastur strukturasi
Dastur ko’rishi Add methods MB ga malumot qo’shish Add methods MB ga malumot qo’shishni koding qismi - getUserInfo() {
- const newUser = {
- fullName: this.fullName,
- departament: this.departament,
- position: this.position,
- gender: this.gender,
- age: +this.age,
- };
- this.newUser = newUser;
- console.log(newUser);
- this.getServer();
- },
async getServer() { - async getServer() {
- console.log("Serverga jo'natdi");
- await axios.post("http://localhost:3000/users", this.newUser, {});
- // await axios.delete("http://localhost:3000/users/"+ this.id)
- // await axios.patch("http://localhost:3000/users/9",this.newUser)
- this.clearInputValue();
- },
- clearInputValue() {
- (this.fullName = ""),
- (this.departament = ""),
- (this.position = ""),
- (this.gender = ""),
- (this.age = ""),
- (this.isChecked = false);
- },
- getRadioAnsver(result) {
- this.gender = result.target.value;
- },
- exitHome() {
- this.$router.push({ path: "/" });
- },
Do'stlaringiz bilan baham: |