seekPage.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <div class="corpus_seekpage">
  3. <Header :projectShow="true" :seekOptions="false" :seekOption="true" />
  4. <div class="title">
  5. <p>语料库词典</p>
  6. <p>Corpus Dictionary</p>
  7. </div>
  8. <div class="seek" @keydown="downSeek">
  9. <input type="text" v-model="keyword" />
  10. <button @click="seekEvent">搜索</button>
  11. </div>
  12. <div class="txt">共{{ 120 }}本教材,合计{{ 123124 }}词。</div>
  13. </div>
  14. </template>
  15. <script>
  16. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  17. //例如:import 《组件名称》from ‘《组件路径》';
  18. import Header from "@/components/Header";
  19. export default {
  20. name: "corpus_seekpage",
  21. //import引入的组件需要注入到对象中才能使用
  22. components: {
  23. Header,
  24. },
  25. props: {},
  26. data() {
  27. //这里存放数据
  28. return {
  29. keyword: null,
  30. };
  31. },
  32. //计算属性 类似于data概念
  33. computed: {},
  34. //监控data中数据变化
  35. watch: {},
  36. //方法集合
  37. methods: {
  38. downSeek(e) {
  39. if (e.keyCode == 13) {
  40. if (!this.keyword) {
  41. this.$message.warning("请先输入内容");
  42. return;
  43. }
  44. this.seekEvent();
  45. }
  46. },
  47. seekEvent() {
  48. if (!this.keyword) {
  49. this.$message.warning("请先输入内容");
  50. return;
  51. }
  52. this.$router.push({
  53. path: "/corpus/Result",
  54. query: {
  55. keyword: this.keyword,
  56. },
  57. });
  58. },
  59. },
  60. //生命周期 - 创建完成(可以访问当前this实例)
  61. created() {},
  62. //生命周期 - 挂载完成(可以访问DOM元素)
  63. mounted() {},
  64. //生命周期-创建之前
  65. beforeCreated() {},
  66. //生命周期-挂载之前
  67. beforeMount() {},
  68. //生命周期-更新之前
  69. beforUpdate() {},
  70. //生命周期-更新之后
  71. updated() {},
  72. //生命周期-销毁之前
  73. beforeDestory() {},
  74. //生命周期-销毁完成
  75. destoryed() {},
  76. //如果页面有keep-alive缓存功能,这个函数会触发
  77. activated() {},
  78. };
  79. </script>
  80. <style lang="scss" scoped>
  81. /* @import url(); 引入css类 */
  82. .corpus_seekpage {
  83. .title {
  84. margin-top: 200px;
  85. > :nth-child(1) {
  86. font-weight: 700;
  87. font-size: 48px;
  88. line-height: 56px;
  89. color: #000000;
  90. margin-bottom: 12px;
  91. }
  92. > :nth-child(2) {
  93. font-weight: 400;
  94. font-size: 20px;
  95. line-height: 23px;
  96. }
  97. > p {
  98. margin: 0;
  99. text-align: center;
  100. }
  101. }
  102. .seek {
  103. margin-top: 41px;
  104. display: flex;
  105. justify-content: center;
  106. height: 51px;
  107. input {
  108. width: 468px;
  109. height: 51px;
  110. border: 1px solid #669aff;
  111. outline: none;
  112. box-sizing: border-box;
  113. padding: 0 10px;
  114. }
  115. button {
  116. width: 96px;
  117. height: 100%;
  118. background: #669aff;
  119. border-width: 1px 1px 1px 0px;
  120. border-style: solid;
  121. border-color: #669aff;
  122. text-align: center;
  123. font-weight: 400;
  124. font-size: 16px;
  125. line-height: 51px;
  126. color: #ffffff;
  127. cursor: pointer;
  128. box-sizing: border-box;
  129. }
  130. }
  131. .txt {
  132. margin-top: 41px;
  133. text-align: center;
  134. font-weight: 400;
  135. font-size: 16px;
  136. line-height: 19px;
  137. color: #000000;
  138. opacity: 0.65;
  139. }
  140. }
  141. </style>