[vue] 테이블 데이터에 연결된 proxy(array) 데이터를 배열로 변환

엑셀형태의 테이블 데이터를 서버에 변수로 보낼 경우 테이블 렌더링에 사용되는 배열 데이터를 바로 사용하면 type이 달라 에러가 발생한다.

const list = ref( [] );
.
.
.
axios.post( 'localhost:8080/api/test', list.value ... )

list.value 타입을 확인해 보면 proxy(array) 라는 형인데 toRaw 함수를 사용하면 순수 배열로 변경이 가능하다

const list = ref( [] );
.
.
.
axios.post( 'localhost:8080/api/test', toRaw( list.value ) ... )

Subscribe to X세대 신입사원

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe
774-86-01972 cinnabar.3d@gmail.com