@zykjcommon/questions 0.0.32 → 0.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zykjcommon/questions",
3
- "version": "0.0.32",
3
+ "version": "0.0.34",
4
4
  "main": "src/components/questions/entry.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -32,7 +32,8 @@ export let setRem = function(){
32
32
  //动态设置html的font-size ----end
33
33
  }
34
34
 
35
- export let setRemFixedHeight = function(designWidth=1440,repairH = 0,scale=1,parent){
35
+ export let setRemFixedHeight = function(designWidth=1440,repairH = 0,scale=1,box){
36
+
36
37
  let baseNum = 100;
37
38
  let winWidth = document.documentElement.clientWidth || document.body.clientWidth;
38
39
  let winHeight = document.documentElement.clientHeight || document.body.clientHeight;
@@ -41,6 +42,6 @@ export let setRemFixedHeight = function(designWidth=1440,repairH = 0,scale=1,par
41
42
  let frameBili = 4.3 / 3
42
43
  let b = frameBili / (winWidth / winHeight)
43
44
  let realW = parseInt(winWidth * b)
44
- parent.style.fontSize = (realW / designWidth) * baseNum * scale + 'px';
45
- console.log(html.style.fontSize);
45
+ box.style.fontSize = (realW / designWidth) * baseNum * scale + 'px';
46
+ // console.log(html.style.fontSize);
46
47
  }
@@ -48,7 +48,9 @@ export default {
48
48
  },
49
49
  bus: {
50
50
  type: Object,
51
- default: {}
51
+ default(){
52
+ return {}
53
+ }
52
54
  },
53
55
  mode: {
54
56
  type: String,
@@ -171,6 +173,8 @@ export default {
171
173
  },
172
174
  intervalFindEl(){
173
175
  return new Promise((resolve,reject)=>{
176
+ console.log(this.$el,345);
177
+ debugger
174
178
  if(this.$el){
175
179
  resolve()
176
180
  }else{
@@ -219,7 +223,15 @@ export default {
219
223
  },
220
224
  setRootFontSize() {
221
225
  // setRemFixedHeight(1000,140,1.08)
222
- setRemFixedHeight(1000,this.screenRepairH,this.screenScale,this.$el)
226
+ // setRemFixedHeight(1000,this.screenRepairH,this.screenScale,this.$el)
227
+ let baseNum = 100;
228
+ let winWidth = document.documentElement.clientWidth || document.body.clientWidth;
229
+ let winHeight = document.documentElement.clientHeight || document.body.clientHeight;
230
+ winHeight = winHeight - this.screenRepairH
231
+ let frameBili = 4.3 / 3
232
+ let b = frameBili / (winWidth / winHeight)
233
+ let realW = parseInt(winWidth * b)
234
+ this.$el.style.fontSize = (realW / 1000) * baseNum * this.screenScale + 'px';
223
235
  },
224
236
  unmountedDo(){
225
237
  window.removeEventListener('resize',this.setRootFontSize)