图片
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="classDetail">
|
||||
<div class="media">
|
||||
<img src="./img/bg.png" alt="">
|
||||
<img src="./img/jige.png" alt="">
|
||||
<!-- <video src="./img/2676.mp4" controls/> -->
|
||||
</div>
|
||||
|
||||
|
||||
@@ -140,12 +140,30 @@ export default {
|
||||
confirm() {
|
||||
uni.navigateTo({url: './result'})
|
||||
},
|
||||
|
||||
/*
|
||||
给定一个字符串 s ,找到 它的第一个不重复的字符,并返回它的索引 。如果不存在,则返回 -1 。
|
||||
s = "leetcode" . => 0
|
||||
s = "loveleetcode" => 2
|
||||
*/
|
||||
firstUniqChar(str) {
|
||||
for(let i=0; i<=str.length; i++) {
|
||||
// let sum = 0;
|
||||
for(let x=0;x<str.length;x++) {
|
||||
if(str[i] === str[x] && i!=x) {
|
||||
console.log(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
// return -1
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.current ++;
|
||||
},
|
||||
onLoad() {
|
||||
// this.createdTime = Date.parse(new Date())
|
||||
this.firstUniqChar('leetcode')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user