element-ui做背单词的网站

2023-11-07 12:32
文章标签 网站 ui element 背单词

本文主要是介绍element-ui做背单词的网站,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

vue关键代码:

<template><el-container><el-header>英语单词墙</el-header><el-container><el-aside width="300px"><el-table :data="tableData" style="width: 100%;cursor:pointer;" @row-click="clickTr"><el-table-column prop="name" label="单词书(点击后需等待10秒加载每本书的单词)" width="300" lazy  ></el-table-column></el-table></el-aside><el-main><el-paginationbackground:current-page="page"layout="prev, pager, next, jumper":total="pagetotal":page-size="perpage"@current-change="changepage"></el-pagination><div class="wai"><el-cardclass="box-card" v-for="(item, index) in dclist2" @mouseenter.native="enter(index)" @mouseleave.native="leave(index)" :key="index"><div class="text item en" ref="en" >{{ item.vocabulary }}</div><div class="text item cn" ref="cn" >{{ item.interpretation}}</div></el-card></div></el-main></el-container></el-container>
</template>
<style>.el-table .warning-row {background: oldlace;
}.el-table .success-row {background: #f0f9eb;
}
.text {font-size: 14px;}.item {padding: 18px 0;}
.cn{transform: scale(0);position: absolute;width: 100%;height: 100%;display:flex;
justify-content: center;
align-items: center;
background: #F2F2F2}
.en{  transform:scale(1);position: absolute;background:#eeeeee;display:flex;width: 100%;height: 100%;
justify-content: center;
align-items: center;}
.el-card__body {transition:0.3s;height: 100%;width: 100%;padding:0px;
position: relative;
display:flex;
justify-content: center;
align-items: center;}
.box-card{width: 20%;height: 100px;margin: 10px;
}
.wai {
display: flex;
flex-wrap: wrap;
width:100%;
height:480px;}
</style>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
section {height: 100%;
}
.el-header,
.el-footer {background-color:  #F2F2F2;color: #333;text-align: center;line-height: 60px;
}.el-aside {background-color: #d3dce6;color: #333;text-align: center;
}
::-webkit-scrollbar {width: 5px;
}
::-webkit-scrollbar-track {background-color: #f5f5f5;
}
::-webkit-scrollbar-thumb {background-color: #fff;border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {background-color: rgba(0, 0, 0, 1);
}
.el-main {background-color: #e9eef3;color: #333;text-align: center;
}body > .el-container {margin-bottom: 40px;
}
</style>
  <script>
import page from "@/components/Pagination";
export default {name: "HelloWorld",data() {return {words: [],tableData: [],page: 1, //当前页码perpage:16, //每页多少条记录pagetotal: 1, //一共有多少条记录};},components: {page,},computed: {dclist2() {var that = this;return this.words.filter(function (item, index) {if (index >= (that.page - 1) * that.perpage &&index < (that.page - 1) * that.perpage + that.perpage) {return item;}});},},methods: {changepage(res) {this.page = res;// this.getdata(this.page,this.perpage)},
enter(index){
// alert("hello")
console.log(index)// console.log(this.$refs.cn)this.$refs.cn[index].style.transform ="scale(1)"this.$refs.en[index].style.transform ="scale(0)"
},leave(index){this.$refs.cn[index].style.transform ="scale(0)"this.$refs.en[index].style.transform ="scale(1)"
},clickTr(event){let that = this;//console.log(row["id"]) 跟下面效果一样console.log(event.fenlei_code)//获取各行id的值axios({url: "接口",method: "GET",header: {"Content-Type": "application/json;charset-UTF-8",},params: {book:event.fenlei_code}}).then((res) => {console.log(res.data);
console.log(that.words)that.words = res.data;console.log(that.words)that.pagetotal = res.data.length; //一共有多少条记录});}},mounted() {axios({url: "接口",method: "GET",header: {"Content-Type": "application/json;charset-UTF-8",},}).then((res) => {console.log(res.data);this.tableData = res.data;this.pagetotal = res.data.length; //一共有多少条记录});},};
</script>

 

这篇关于element-ui做背单词的网站的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/363625

相关文章

VS配置好Qt环境之后但无法打开ui界面的问题解决

《VS配置好Qt环境之后但无法打开ui界面的问题解决》本文主要介绍了VS配置好Qt环境之后但无法打开ui界面的问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要... 目UKeLvb录找到Qt安装目录中designer.UKeLvBexe的路径找到vs中的解决方案资源

如何关闭Mac的Safari通知? 3招教你关闭Safari浏览器网站通知的技巧

《如何关闭Mac的Safari通知?3招教你关闭Safari浏览器网站通知的技巧》当我们在使用Mac电脑专注做一件事情的时候,总是会被一些消息推送通知所打扰,这时候,我们就希望关闭这些烦人的Mac通... Safari 浏览器的「通知」功能本意是为了方便用户及时获取最新资讯,但很容易被一些网站滥用,导致我们

Web技术与Nginx网站环境部署教程

《Web技术与Nginx网站环境部署教程》:本文主要介绍Web技术与Nginx网站环境部署教程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、Web基础1.域名系统DNS2.Hosts文件3.DNS4.域名注册二.网页与html1.网页概述2.HTML概述3.

QT6中绘制UI的两种方法详解与示例代码

《QT6中绘制UI的两种方法详解与示例代码》Qt6提供了两种主要的UI绘制技术:​​QML(QtMeta-ObjectLanguage)​​和​​C++Widgets​​,这两种技术各有优势,适用于不... 目录一、QML 技术详解1.1 QML 简介1.2 QML 的核心概念1.3 QML 示例:简单按钮

在 PyQt 加载 UI 三种常见方法

《在PyQt加载UI三种常见方法》在PyQt中,加载UI文件通常指的是使用QtDesigner设计的.ui文件,并将其转换为Python代码,以便在PyQt应用程序中使用,这篇文章给大家介绍在... 目录方法一:使用 uic 模块动态加载 (不推荐用于大型项目)方法二:将 UI 文件编译为 python 模

nginx部署https网站的实现步骤(亲测)

《nginx部署https网站的实现步骤(亲测)》本文详细介绍了使用Nginx在保持与http服务兼容的情况下部署HTTPS,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值... 目录步骤 1:安装 Nginx步骤 2:获取 SSL 证书步骤 3:手动配置 Nginx步骤 4:测

Vue项目中Element UI组件未注册的问题原因及解决方法

《Vue项目中ElementUI组件未注册的问题原因及解决方法》在Vue项目中使用ElementUI组件库时,开发者可能会遇到一些常见问题,例如组件未正确注册导致的警告或错误,本文将详细探讨这些问题... 目录引言一、问题背景1.1 错误信息分析1.2 问题原因二、解决方法2.1 全局引入 Element

Python中的可视化设计与UI界面实现

《Python中的可视化设计与UI界面实现》本文介绍了如何使用Python创建用户界面(UI),包括使用Tkinter、PyQt、Kivy等库进行基本窗口、动态图表和动画效果的实现,通过示例代码,展示... 目录从像素到界面:python带你玩转UI设计示例:使用Tkinter创建一个简单的窗口绘图魔法:用

element-ui下拉输入框+resetFields无法回显的问题解决

《element-ui下拉输入框+resetFields无法回显的问题解决》本文主要介绍了在使用ElementUI的下拉输入框时,点击重置按钮后输入框无法回显数据的问题,具有一定的参考价值,感兴趣的... 目录描述原因问题重现解决方案方法一方法二总结描述第一次进入页面,不做任何操作,点击重置按钮,再进行下

HarmonyOS学习(七)——UI(五)常用布局总结

自适应布局 1.1、线性布局(LinearLayout) 通过线性容器Row和Column实现线性布局。Column容器内的子组件按照垂直方向排列,Row组件中的子组件按照水平方向排列。 属性说明space通过space参数设置主轴上子组件的间距,达到各子组件在排列上的等间距效果alignItems设置子组件在交叉轴上的对齐方式,且在各类尺寸屏幕上表现一致,其中交叉轴为垂直时,取值为Vert