comento-ui icon indicating copy to clipboard operation
comento-ui copied to clipboard

Checkbox가 클릭안되는 이슈

Open donghoon-song opened this issue 4 years ago • 1 comments

Pasted_image_at_21-11-29-11-50

input id랑 label for가 일치해야 하는데 아래와 같이 페이지에서 동시에 렌더링이 안되는 경우에도 불구하고 코드상에 포함되어 있으면 uid가 꼬이는 거 같음. uid 부여방식을 개선해야 할 거 같네요.

Pasted_image_at_21-11-29-11-59

donghoon-song avatar Nov 29 '21 03:11 donghoon-song

data() {    
	return {
		uid: uniqueId(),
	};
},
computed: {
	computedId() {
		return this.id || `c-checkbox-${this.uid}`;
	},
}

여기서 쓰는 uniqueId()가

let idCount = 0;

function uniqueId() {
	return ++idCount;
}

export default uniqueId;

인데 input과 label의 computed 시점이 달라서 그럴까요?

LuiGeeDev avatar Nov 29 '21 05:11 LuiGeeDev